/**
 * Slot Machine, July 2012
 *
 * Owner: Rami Abou Ghanem
 * Owner: Sumbul Alvi
 *
 */

package Gui;

import java.awt.Color;
import java.awt.Graphics;

// this class shouldn't have any constants
public class DrawSlots {
	int x , y, h, w, cols ;
	Graphics g ;
	
	public DrawSlots (int cols, int x, int y,int h, int w, Graphics g)
	{
		this.x = x ;
		this.y = y ;
		this.h = h ;
		this.w = w ;
		this.g = g ;
		this.cols = cols ;
	}
	
	public void drawToDisplay()
	{
		int origX = x ;
		int origY = y ;	
		Color c ;
		Color[] slotColors = {Color.BLUE, Color.MAGENTA, Color.RED};

		for ( int i = 0 ; i < cols ; i ++)
		{
			c = slotColors[i] ;
			for (int j = 0 ; j < cols ; j++)
			{
				drawOneSlot (x, y,g,c) ;
				y+=h ;
			}
			x+=w ; y = origY ;
		}		
	}
	public void drawOneSlot(int x, int y, Graphics g, Color c)
	{
		g.setColor(c) ;
		g.drawRect(x,y,w,h);
	}
	
}
